public class Num4 {
    public static void main(String[] args) {
        int a=1;
        int sum=0;
        while (a<=1000) {
            sum += a;
            a++;
        }
        System.out.println("sum="+sum);
        }
    }

